/*
 * customerChange.java
 *
 * Created on 12 novembre 2008, 10:30
 */

package GUI;

import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import kernel.Customer;

/**
 *
 * @author  coco
 */
public class customerChange extends javax.swing.JFrame {

    /** Creates new form customerChange */
    public customerChange() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        customerChangeIdLabel = new javax.swing.JLabel();
        customerChangeIdInfo = new javax.swing.JLabel();
        customerChangeSurnameLabel = new javax.swing.JLabel();
        customerChangeLicenseDateLabel = new javax.swing.JLabel();
        customerChangeBirthLabel = new javax.swing.JLabel();
        customerChangeLicenseClassLabel = new javax.swing.JLabel();
        customerChangeAddressLabel = new javax.swing.JLabel();
        customerChangeAnredeLabel = new javax.swing.JLabel();
        customerChangeTelefonLabel = new javax.swing.JLabel();
        customerChangeTelefonField = new javax.swing.JTextField();
        customerChangeAddressField = new javax.swing.JTextField();
        customerChangeLicenseClassField = new javax.swing.JTextField();
        customerChangeSurnameField = new javax.swing.JTextField();
        customerChangeRegisterDateLabel = new javax.swing.JLabel();
        customerChangeRegisterDateInfo = new javax.swing.JLabel();
        customerChangeCompanyLabel = new javax.swing.JLabel();
        customerChangeFirstnameLabel = new javax.swing.JLabel();
        customerChangeausweisnummerLabel = new javax.swing.JLabel();
        customerChangeausweisnummerField = new javax.swing.JTextField();
        customerChangeFirstnameField = new javax.swing.JTextField();
        customerChangeCompanyField = new javax.swing.JTextField();
        customerChangePrintButton = new javax.swing.JButton();
        customerChangeCancelButton = new javax.swing.JButton();
        customerChangeSaveButton = new javax.swing.JButton();
        customerChangeLicenseDateField = new javax.swing.JFormattedTextField();
        customerChangeBirthField = new javax.swing.JFormattedTextField();
        customerChangeDiscountFactorLabel = new javax.swing.JLabel();
        customerChangeDiscountFactorField = new javax.swing.JTextField();
        customerChangeAnredeField = new javax.swing.JComboBox();

        setResizable(false);

        customerChangeIdLabel.setText("Kundennummer");

        customerChangeIdInfo.setText("XX");

        customerChangeSurnameLabel.setText("Nachname");

        customerChangeLicenseDateLabel.setText("Führerscheindatum");

        customerChangeBirthLabel.setText("Geburtsdatum");

        customerChangeLicenseClassLabel.setText("Führerscheinklassen");

        customerChangeAddressLabel.setText("Adresse");

        customerChangeAnredeLabel.setText("Anrede");

        customerChangeTelefonLabel.setText("Telefonnummer");

        customerChangeTelefonField.setText("jTextField3");
        customerChangeTelefonField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangeTelefonFieldActionPerformed(evt);
            }
        });

        customerChangeAddressField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangeAddressFieldActionPerformed(evt);
            }
        });

        customerChangeSurnameField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangeSurnameFieldActionPerformed(evt);
            }
        });

        customerChangeRegisterDateLabel.setText("Anmeldedatum");

        customerChangeRegisterDateInfo.setText("XX-XX-XX");

        customerChangeCompanyLabel.setText("Firmenname");

        customerChangeFirstnameLabel.setText("Vorname");

        customerChangeausweisnummerLabel.setText("Ausweisnummer");

        customerChangePrintButton.setText("Drucken");
        customerChangePrintButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangePrintButtonActionPerformed(evt);
            }
        });

        customerChangeCancelButton.setText("Abbrechen");
        customerChangeCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangeCancelButtonActionPerformed(evt);
            }
        });

        customerChangeSaveButton.setText("Speichern");
        customerChangeSaveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customerChangeSaveButtonActionPerformed(evt);
            }
        });

        try {
            customerChangeLicenseDateField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.##.####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            customerChangeBirthField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.##.####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        customerChangeDiscountFactorLabel.setText("Rabattfaktor");

        customerChangeAnredeField.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Herr", "Frau" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(105, 105, 105)
                        .addComponent(customerChangePrintButton, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(customerChangeCancelButton, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(customerChangeIdLabel)
                                .addGap(18, 18, 18)
                                .addComponent(customerChangeIdInfo))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(customerChangeSurnameLabel)
                                    .addComponent(customerChangeLicenseDateLabel)
                                    .addComponent(customerChangeLicenseClassLabel)
                                    .addComponent(customerChangeAddressLabel)
                                    .addComponent(customerChangeAnredeLabel)
                                    .addComponent(customerChangeTelefonLabel)
                                    .addComponent(customerChangeBirthLabel))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(customerChangeAnredeField, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(customerChangeLicenseDateField, 0, 0, Short.MAX_VALUE)
                            .addComponent(customerChangeTelefonField)
                            .addComponent(customerChangeAddressField)
                            .addComponent(customerChangeLicenseClassField)
                            .addComponent(customerChangeSurnameField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
                            .addComponent(customerChangeBirthField, javax.swing.GroupLayout.Alignment.TRAILING, 0, 0, Short.MAX_VALUE))
                        .addGap(9, 9, 9)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(customerChangeRegisterDateLabel)
                        .addGap(18, 18, 18)
                        .addComponent(customerChangeRegisterDateInfo, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
                    .addComponent(customerChangeSaveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(customerChangeCompanyLabel)
                            .addComponent(customerChangeFirstnameLabel)
                            .addComponent(customerChangeausweisnummerLabel)
                            .addComponent(customerChangeDiscountFactorLabel))
                        .addGap(16, 16, 16)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(customerChangeDiscountFactorField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customerChangeausweisnummerField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customerChangeFirstnameField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customerChangeCompanyField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {customerChangeCompanyLabel, customerChangeFirstnameLabel, customerChangeRegisterDateLabel, customerChangeausweisnummerLabel});

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {customerChangeCompanyField, customerChangeFirstnameField, customerChangeausweisnummerField});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeIdLabel)
                            .addComponent(customerChangeIdInfo))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeSurnameLabel)
                            .addComponent(customerChangeSurnameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeBirthField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customerChangeBirthLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeLicenseDateLabel)
                            .addComponent(customerChangeLicenseDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeLicenseClassLabel)
                            .addComponent(customerChangeLicenseClassField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(customerChangeDiscountFactorLabel)
                            .addComponent(customerChangeDiscountFactorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeAddressLabel)
                            .addComponent(customerChangeAddressField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeAnredeLabel)
                            .addComponent(customerChangeAnredeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeTelefonLabel)
                            .addComponent(customerChangeTelefonField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeRegisterDateLabel)
                            .addComponent(customerChangeRegisterDateInfo))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeFirstnameLabel)
                            .addComponent(customerChangeFirstnameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeCompanyLabel)
                            .addComponent(customerChangeCompanyField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(customerChangeausweisnummerLabel)
                            .addComponent(customerChangeausweisnummerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(customerChangePrintButton)
                    .addComponent(customerChangeCancelButton)
                    .addComponent(customerChangeSaveButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void customerChangeTelefonFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangeTelefonFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_customerChangeTelefonFieldActionPerformed

private void customerChangeAddressFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangeAddressFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_customerChangeAddressFieldActionPerformed

private void customerChangeSurnameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangeSurnameFieldActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_customerChangeSurnameFieldActionPerformed

private void customerChangePrintButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangePrintButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_customerChangePrintButtonActionPerformed

private void customerChangeCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangeCancelButtonActionPerformed
//this.setEnabled(true);
this.setVisible(false);
}//GEN-LAST:event_customerChangeCancelButtonActionPerformed

private void customerChangeSaveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customerChangeSaveButtonActionPerformed

    if (addupdate==1){
    String Anrede;
    if(customerChangeBirthField.getText().equals("  .  .    ")){customerChangeBirthField.setText("01.01.0001");}
    if(customerChangeLicenseDateField.getText().equals("  .  .    ")){customerChangeLicenseDateField.setText("01.01.0001");}
    if(customerChangeAnredeField.getSelectedItem().equals("Herr")){Anrede="1";} else{Anrede="2";}
   
    if ( customerChangeSurnameField.getText().equals("") ||customerChangeFirstnameField.getText().equals("")||customerChangeBirthField.getText().equals("")){
     JOptionPane.showMessageDialog(null, "Sie mussen der Name, der Vorname und das Geburtstagdatum  angeben","ERROR",JOptionPane.ERROR_MESSAGE) ;
}
else{
 String zuruck = null;
                try {
                    zuruck = Customer.newCustomer(GUI.LoginWindow.sessionID, customerChangeSurnameField.getText(), customerChangeFirstnameField.getText(), customerChangeBirthField.getText(), customerChangeLicenseDateField.getText(), customerChangeLicenseClassField.getText(), customerChangeAddressField.getText(), Anrede, customerChangeTelefonField.getText(), customerChangeausweisnummerField.getText() , customerChangeCompanyField.getText(), customerChangeDiscountFactorField.getText());
                } catch (ParseException ex) {
                    Logger.getLogger(customerChange.class.getName()).log(Level.SEVERE, null, ex);
                }
 if(zuruck.equals("1")){     JOptionPane.showMessageDialog(null, "Sie wurden ausgeloggt!Bitte versuchen Sie sich wieder einzuloggen","ERROR",JOptionPane.ERROR_MESSAGE) ;}
 if(zuruck.equals("2")){     JOptionPane.showMessageDialog(null, "Der Kunden existiert bereits","ERROR",JOptionPane.ERROR_MESSAGE) ;}
 else{
                JOptionPane.showMessageDialog(null, "Der Kunde wurde hinzugefügt","Neuer Kunde",JOptionPane.INFORMATION_MESSAGE) ;
                this.setEnabled(true);
                this.dispose();
                        String données[][] = null;
                    try {
                        données = kernel.Customer.searchcustomer(GUI.LoginWindow.sessionID, 1, "%%");
                    } catch (ParseException ex) {
                        Logger.getLogger(customerChange.class.getName()).log(Level.SEVERE, null, ex);
                    }

        //on affiche la jTable des utilisateurs'
        String[] nomsColonne={"Kundennummer","Anrede","Name","Vornamel","Geburtsdatum","Adresse","Telefon","Fs. Klassen","Fs. Datum","RabattFaktor"};
        CustomEditableCellTableModel jTable2 =new CustomEditableCellTableModel(données,nomsColonne) ;
        GUI.customerTab.customerTable.setModel(jTable2);
        GUI.customerTab.customerTable=GUI.customerTab.centrerTable(GUI.customerTab.customerTable);
        GUI.customerTab.customerTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        GUI.customerTab.customerTable.setAutoCreateRowSorter(true);
 }
}
    }
if(addupdate==2){
    String Anrede;
    if(customerChangeBirthField.getText().equals("  .  .    ")){customerChangeBirthField.setText("01.01.0001");}
    if(customerChangeLicenseDateField.getText().equals("  .  .    ")){customerChangeLicenseDateField.setText("01.01.0001");}
    if(customerChangeAnredeField.getSelectedItem().equals("Herr")){Anrede="1";} else{Anrede="2";}

    if ( customerChangeSurnameField.getText().equals("") ||customerChangeFirstnameField.getText().equals("")||customerChangeBirthField.getText().equals("")){
     JOptionPane.showMessageDialog(null, "Sie mussen der Name, der Vorname und das Geburtstagdatum  angeben","ERROR",JOptionPane.ERROR_MESSAGE) ;
}
else{
 String zuruck = null;
                try {
                    zuruck = Customer.updateCustomer(GUI.LoginWindow.sessionID, customerChangeIdInfo.getText(), customerChangeSurnameField.getText(), customerChangeFirstnameField.getText(), customerChangeBirthField.getText(), customerChangeLicenseDateField.getText(), customerChangeLicenseClassField.getText(), customerChangeAddressField.getText(), Anrede, customerChangeTelefonField.getText(), customerChangeausweisnummerField.getText(), customerChangeCompanyField.getText(), "1", Float.parseFloat(customerChangeDiscountFactorField.getText()));
                } catch (ParseException ex) {
                    Logger.getLogger(customerChange.class.getName()).log(Level.SEVERE, null, ex);
                }
System.out.println(zuruck);
if(zuruck!=null){
 if(zuruck.equals("1")){     JOptionPane.showMessageDialog(null, "Sie wurden ausgeloggt!Bitte versuchen Sie sich wieder einzuloggen","ERROR",JOptionPane.ERROR_MESSAGE) ;}
}
 else{
                JOptionPane.showMessageDialog(null, "Der Kunde wurde modifiert","modifier Kunde",JOptionPane.INFORMATION_MESSAGE) ;
                this.setEnabled(true);
                this.dispose();
                                        String données[][] = null;
                    try {
                        données = kernel.Customer.searchcustomer(GUI.LoginWindow.sessionID, 1, "%%");
                    } catch (ParseException ex) {
                        Logger.getLogger(customerChange.class.getName()).log(Level.SEVERE, null, ex);
                    }

        //on affiche la jTable des utilisateurs'
        String[] nomsColonne={"Kundennummer","Anrede","Name","Vornamel","Geburtsdatum","Adresse","Telefon","Fs. Klassen","Fs. Datum","RabattFaktor"};
        CustomEditableCellTableModel jTable2 =new CustomEditableCellTableModel(données,nomsColonne) ;
        GUI.customerTab.customerTable.setModel(jTable2);
        GUI.customerTab.customerTable=GUI.customerTab.centrerTable(GUI.customerTab.customerTable);
        GUI.customerTab.customerTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        GUI.customerTab.customerTable.setAutoCreateRowSorter(true);
 }

}
}
}//GEN-LAST:event_customerChangeSaveButtonActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new customerChange().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JTextField customerChangeAddressField;
    private javax.swing.JLabel customerChangeAddressLabel;
    public javax.swing.JComboBox customerChangeAnredeField;
    private javax.swing.JLabel customerChangeAnredeLabel;
    public javax.swing.JFormattedTextField customerChangeBirthField;
    private javax.swing.JLabel customerChangeBirthLabel;
    private javax.swing.JButton customerChangeCancelButton;
    public javax.swing.JTextField customerChangeCompanyField;
    private javax.swing.JLabel customerChangeCompanyLabel;
    public javax.swing.JTextField customerChangeDiscountFactorField;
    public javax.swing.JLabel customerChangeDiscountFactorLabel;
    public javax.swing.JTextField customerChangeFirstnameField;
    private javax.swing.JLabel customerChangeFirstnameLabel;
    public javax.swing.JLabel customerChangeIdInfo;
    public javax.swing.JLabel customerChangeIdLabel;
    public javax.swing.JTextField customerChangeLicenseClassField;
    private javax.swing.JLabel customerChangeLicenseClassLabel;
    public javax.swing.JFormattedTextField customerChangeLicenseDateField;
    private javax.swing.JLabel customerChangeLicenseDateLabel;
    private javax.swing.JButton customerChangePrintButton;
    public javax.swing.JLabel customerChangeRegisterDateInfo;
    private javax.swing.JLabel customerChangeRegisterDateLabel;
    private javax.swing.JButton customerChangeSaveButton;
    public javax.swing.JTextField customerChangeSurnameField;
    private javax.swing.JLabel customerChangeSurnameLabel;
    public javax.swing.JTextField customerChangeTelefonField;
    private javax.swing.JLabel customerChangeTelefonLabel;
    public javax.swing.JTextField customerChangeausweisnummerField;
    public javax.swing.JLabel customerChangeausweisnummerLabel;
    // End of variables declaration//GEN-END:variables
public static int addupdate;
}
